package com.avo.ramcache.anno.core.type;

import com.avo.ramcache.manager.CacheServiceManager;
import com.avo.ramcache.service.ICacheService;

@SuppressWarnings({"unchecked", "rawtypes"})
public enum CacheUnit {

    ENTITY() {
        @Override
        public ICacheService getCacheService(CacheServiceManager cacheServiceManager, Class clz) {
            return cacheServiceManager.getEntityService(clz);
        }
    },

    REGION() {
        @Override
        public ICacheService getCacheService(CacheServiceManager cacheServiceManager, Class clz) {
            return cacheServiceManager.getRegionService(clz);
        }
    };

    CacheUnit() {
    }


    public ICacheService getCacheService(CacheServiceManager cacheServiceManager, Class clz) {
        throw new RuntimeException("重写方法");
    }
}
